table.insert(itemActions,
	function(item, action)
		-- RARE rings
		-- see: dir .. "readme.txt" for information regarding these variables
		local priority = 7
		local identify = true
		local dump = true

		if not (item.quality == ItemQuality.Rare and item.baseItem.code == "rin") then 
			return false
		elseif action == aPICK and (not item.flags.Identified or isGoodRareRing(item)) then
			return priority
		elseif action == aIDENT then
			return identify
		elseif action == aSELL and item.flags.Identified and not isGoodRareRing(item) then
			return true
		elseif action == aDUMP and item.flags.Identified and not isGoodRareRing(item) then
			return dump
		end

		return false
	end
)

function isGoodRareRing(item)
	-- still needs work/testing
	local points = 0
	local fcr = 0
	local stat, hp, mp, ll, ml = 0, 0, 0, 0, 0
	
	if hasRes(item, 9, 4) then
		points = 5
	elseif points == 0 and hasRes(item, 12, 3) then
		points = 5
	elseif points == 0 and hasRes(item, 16, 2) then
		points = 5
	elseif points == 0 and hasRes(item, 20, 1) then
		points = 4
	elseif points == 0 and hasRes(item, 25, 1) then
		points = 5
	end
	
	for i = 0, item.mods:size() - 1 do
		if item.mods[i].Stat.Type == StatType.FasterCastRate then
			fcr = 1
		elseif (item.mods[i].Stat.Type == StatType.Strength or
				item.mods[i].Stat.Type == StatType.Dexterity or
				item.mods[i].Stat.Type == StatType.Energy) and
				item.mods[i].Value >= 10 then -- 10+str/dex/eng
			stat = 1
		elseif item.mods[i].Stat.Type == StatType.MaxLife and
				item.mods[i].Value >= 21 then -- 21+hp
			hp = 1
		elseif item.mods[i].Stat.Type == StatType.MaxMana and
				item.mods[i].Value >= 30 then -- 41+mp
			mp = 1
		elseif item.mods[i].Stat.Type == StatType.LifeDrainMinDamage and
				item.mods[i].Value >= 5 then -- 5+ll
			ll = 1
		elseif item.mods[i].Stat.Type == StatType.ManaDrainMinDamage and
				item.mods[i].Value >= 5 then -- 5+ml
			ml = 1
		end
	end

	--[[
	points
	30+sres: 1
	20+dres: 3
	15+tres: 4
	8+ares: 2

	fcr: 4
	10+stat: 3
	41+hp: 3
	61+mp: 2
	6+ll: 0.5
	6+ml: 0.5
	ll+ml: 3
	]]--
	
	if (ll + ml) == 2 then
		points = points + 6
	else
		points = points + 0.5*(ll + ml)
	end

	points = points + 4*fcr + 3*(stat + hp) + 2*mp
	
	return (points >= 5)
end

--[[
	high end mods
	prefix
	mp 61-90
	singleres 21-30
	allres 8-11
	
	suffix
	str 16-20
	dex 10-15
	eng 11-15
	hp 31-40
	ll 6-9
	ml 6-9
	fcr 10
]]--
